import { defineConfig } from "umi";
import PostcssPxtoRem from "postcss-pxtorem";
import routes from "./routes";
export default defineConfig({
  routes,
  alias: {
    "@": "/src",
    "@p": "/src/pages",
    "@u": "/src/utils",
  },

  // 移动端适配
  extraPostCSSPlugins: [
    PostcssPxtoRem({
      rootValue: 40, // PX 自动不转换rem
      exclude: /node_modules/i,
    }),
  ],

  proxy: {
    "/conner": {
      target: "https://api.it120.cc",
      changeOrigin: true,
      pathRewrite: { "^/conner": "/conner" },
    },
  },

  dva: {},
  plugins: ["@umijs/plugins/dist/dva"],
});
